package com.gzhryc.dictionary.dao.db;

import java.util.Date;
import java.util.List;

import com.gzhryc.common.data.ITreeEntity;
import com.gzhryc.dictionary.dao.enums.CountryAreaEnum;
import com.gzhryc.jdbc.annotaion.Column;
import com.gzhryc.jdbc.annotaion.Id;
import com.gzhryc.jdbc.annotaion.Join;
import com.gzhryc.jdbc.annotaion.Table;
import com.gzhryc.jdbc.models.LRTree;

@Table(name = "dic_country_area")
public class CountryArea extends LRTree<Long> implements ITreeEntity<CountryArea, Long> {

	private static final long serialVersionUID = 1L;

	@Id(auto = false)
	protected Long id;

	@Column(name = "country_id", notNull = true)
	protected Long countryId;

	@Column(notNull = true)
	protected String name;

	@Column(name = "full_name")
	protected String fullName;

	@Column(note = "拼音")
	protected String pinyin;
	
	@Column(note = "别称")
	protected String code;

	@Column
	protected Double lng;

	@Column
	protected Double lat;

	@Column(length = 4, notNull = true)
	protected Integer type;

	@Column(length = 4, defVal = "10")
	protected Integer priority;

	@Column(length = 4, defVal = "1")
	protected Integer status;

	@Column(name = "left_num")
	protected Long leftNum;

	@Column(name = "right_num")
	protected Long rightNum;

	@Column(name = "root_id")
	protected Long rootId;

	@Column(name = "parent_id")
	protected Long parentId;

	@Column(name = "update_date", autoUpdateTime = true)
	protected Date updateDate;

	@Column(name = "create_date")
	protected Date createDate;

	@Join(fromField = "countyId")
	protected Country county;

	public List<CountryArea> children;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getFullName() {
		return fullName;
	}

	public void setFullName(String fullName) {
		this.fullName = fullName;
	}

	public Double getLng() {
		return lng;
	}

	public void setLng(Double lng) {
		this.lng = lng;
	}

	public Double getLat() {
		return lat;
	}

	public void setLat(Double lat) {
		this.lat = lat;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public Integer getPriority() {
		return priority;
	}

	public void setPriority(Integer priority) {
		this.priority = priority;
	}

	public Long getLeftNum() {
		return leftNum;
	}

	public void setLeftNum(Long leftNum) {
		this.leftNum = leftNum;
	}

	public Long getRightNum() {
		return rightNum;
	}

	public void setRightNum(Long rightNum) {
		this.rightNum = rightNum;
	}

	public Long getRootId() {
		return rootId;
	}

	public void setRootId(Long rootId) {
		this.rootId = rootId;
	}

	public Long getParentId() {
		return parentId;
	}

	public void setParentId(Long parentId) {
		this.parentId = parentId;
	}

	public Date getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public String getTypeName() {
		return CountryAreaEnum.Type.note(this.type);
	}

	public String getStatusName() {
		return CountryAreaEnum.Status.note(this.status);
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public String getPinyin() {
		return pinyin;
	}

	public void setPinyin(String pinyin) {
		this.pinyin = pinyin;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public Long getCountryId() {
		return countryId;
	}

	public void setCountryId(Long countryId) {
		this.countryId = countryId;
	}

	public Country getCounty() {
		return county;
	}

	public void setCounty(Country county) {
		this.county = county;
	}

	public List<CountryArea> getChildren() {
		return children;
	}

	public void setChildren(List<CountryArea> children) {
		this.children = children;
	}

	@Override
	public String toString() {
		return "CountryArea [id=" + id + ", countryId=" + countryId + ", name=" + name + ", fullName=" + fullName
				+ ", pinyin=" + pinyin + ", code=" + code + ", type=" + type + ", priority=" + priority + ", status="
				+ status + ", leftNum=" + leftNum + ", rightNum=" + rightNum + ", rootId=" + rootId + ", parentId="
				+ parentId + ", updateDate=" + updateDate + ", createDate=" + createDate + ", county=" + county
				+ ", children=" + children + "]";
	}
	
}
